package com.greensam.pixelengine.pojo.base;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Macro_Ray
 * @since 2025/6/13 15:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "分页查询参数")
public class PageRequest extends BaseDto {

    /**
     * 当前页号
     */
    @Schema(title = "当前页号")
    private Integer pageNum = 1;

    /**
     * 页面大小
     */
    @Schema(title = "页面大小")
    private Integer pageSize = 10;

    public long offset() {
        return (long) (this.pageNum - 1) * this.pageSize;
    }
}
